package org.blade.personal.dao.sys.impl;

import java.util.List;
import java.util.Map;

import org.blade.personal.dao.base.BaseDao2;
import org.blade.personal.dao.sys.SystemUrlDao;
import org.blade.personal.mode.sys.SystemUrl;
import org.blade.personal.utils.Pager;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

@Repository("SystemUrlDao")
public class SystemUrlDaoImpl extends BaseDao2<SystemUrl,Long> implements SystemUrlDao {

	@Override
	public void add(SystemUrl u) {
		// TODO Auto-generated method stub
		this.add(u);
		
	}

	@Override
	public void update(SystemUrl u) {
		super.update(u);
	}

	public int delete(String ids) {
		return this.delete("delete from sys_url where id in (?) ", ids);
	}

	@Override
	public void delete(Long id) {

		super.deleteById(id);
	}

	@Override
	public List<SystemUrl> queryForChildren(Long id) {
		return this.queryForList("select * from sys_url where parent_id =  ? ", new Object[]{id});
	}

	@Override
	public List queryForAll() {
		return this.findList();
	}

	@Override
	public List<SystemUrl> queryForList(String querySql) {
		return this.findObjectListBySql(querySql, null);
	}

	@Override
	public SystemUrl queryOne(Long id) {
		return this.getById(id);
	}

	@Override
	public void pagingQuery(Pager<SystemUrl> page, Map params) {
		// TODO Auto-generated method stub
	}

	@Override
	public void pagingQuery(Pager<SystemUrl> page, String querySql,
			Object[] params, RowMapper<SystemUrl> rowMapper) {
		this.pagingQuery(page, querySql, params, rowMapper);
	}

}
